<?php
namespace app\index\controller;
use think\Db;

class Index extends Base
{
    public function index(){
        $arters = Db::name('article')
            -> alias('a')
            -> join('cate c', 'c.id = a.cate_id', 'LEFT')
            -> field('a.*, c.catename')
            -> order('a.id DESC')
            -> paginate(2);



        $this -> assign('arters', $arters);
        return $this -> fetch();
    }
}
